import { computed } from "vue";
import { $t } from "@/plugins/i18n";

type MenuTypeOptions = Array<{
    label: string;
    type: string;
    value: CustomizeRouteMeta["menuType"];
}>;

interface UseMenuOptions {
    /** 菜单类型选项 */
    menuTypeOptions: MenuTypeOptions;
}

export function useMenuOptions(): UseMenuOptions {
    const menuTypeOptions: MenuTypeOptions = [
        { label: computed(() => $t("label.menu")).value, type: "primary", value: "menu" },
        { label: "iframe", type: "success", value: "iframe" },
        { label: computed(() => $t("label.externalLink")).value, type: "warning", value: "external" },
        { label: computed(() => $t("label.button")).value, type: "danger", value: "button" },
    ];

    return {
        menuTypeOptions,
    };
}
